#include "datas.h"

datas::datas(QObject *parent) : QObject(parent)
{
    QRandomGenerator *generator = QRandomGenerator::global();
        int count = generator->generate() % 100;
        double xAccumulated = 0;
        for(int i = 0;i < count;i ++)
        {
            double x = generator->generateDouble() / (double)count * 2;
            xAccumulated += x;
            double y = generator->generateDouble();
            m_map.append(QPair<double, double>(xAccumulated, y));
        }
}
int datas::count()
{
    return m_map.count();
}

double datas::getX(int index)
{
    return m_map.at(index).first;
}

double datas::getY(int index)
{
    return m_map.at(index).second;
}
